<?php
	function findUser($user_name, $pwd)
	{
		
		$user = escapeValue($user_name);
		$pwd = escapeValue($pwd);
		
		$sql = "SELECT user_id, user_name, password,type FROM tbl_user WHERE ";
		$sql .= "user_name='{$user_name}' and password='{$pwd}' and active=1 LIMIT 1";
		$result = query($sql);
		
		return num_rows($result)>0 ? $result : false;
	}
?>